package com.marisfrolg.utils;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.List;

/**
 * @BelongsProject: oauth-demos
 * @BelongsPackage: com.marisfrolg.utils
 * @Author: 毕苗苗
 * @CreateTime: 2023-01-05  14:46
 * @Description: TODO
 * @Version: 1.0
 */
public class IntactCheckUtil {
    public static boolean check(Object obj){
        // list = Arrays.asList(AnnotationParsing.class.getClassLoader().loadClass(((Class)obj).getClass().getName()).getDeclaredFields());
        List<Field> list = Arrays.asList(obj.getClass().getDeclaredFields());
        for(int i=0;i<list.size();i++){
            Field field = list.get(i);
            if(field.isAnnotationPresent(GetMapping.class)){//是否使用MyAnno注解
                for (Annotation anno : field.getDeclaredAnnotations()) {//获得所有的注解
                    if(anno.annotationType().equals(RequestMapping.class) ){//找到自己的注
                    }
                }
            }

        }
        return  true;
    }

}